package com.xu.sms.utils;

import java.util.HashMap;
import java.util.Map;

import com.xu.sms.R;

public class TypePictureUtil {
	
	static Map<String,Integer> fms = new HashMap<String, Integer>();
	
	static{
		//设置节日
		fms.put("ic_yuandan", R.drawable.ic_yuandan);fms.put("ic_laba", R.drawable.ic_laba);
		fms.put("ic_lichun", R.drawable.ic_lichun);fms.put("ic_xiaonian", R.drawable.ic_xiaonian);
		fms.put("ic_qinrenjie", R.drawable.ic_qinrenjie);fms.put("ic_chuxi", R.drawable.ic_chuxi);
		fms.put("ic_chunjie", R.drawable.ic_chunjie);fms.put("ic_caisheng", R.drawable.ic_caisheng);
		fms.put("ic_yuanxiao", R.drawable.ic_yuanxiao);fms.put("ic_nvshengjie", R.drawable.ic_nvshengjie);
		fms.put("ic_funvjie", R.drawable.ic_funvjie); fms.put("ic_spring_dragon", R.drawable.ic_spring_dragon);
		fms.put("ic_yurenjie", R.drawable.ic_yurenjie);fms.put("ic_qingming", R.drawable.ic_qingming);
		fms.put("ic_woaini", R.drawable.ic_woaini);fms.put("ic_children", R.drawable.ic_children);
		fms.put("ic_fuqingjie", R.drawable.ic_fuqingjie);fms.put("ic_duanwu", R.drawable.ic_duanwu);
		fms.put("ic_qixi", R.drawable.ic_qixi);fms.put("ic_laodongjie", R.drawable.ic_laodongjie);
		fms.put("ic_ghost", R.drawable.ic_ghost);fms.put("ic_jiaoshijie", R.drawable.ic_jiaoshijie);
		fms.put("ic_zhongqiu", R.drawable.ic_zhongqiu);fms.put("ic_guoqing", R.drawable.ic_guoqing);
		fms.put("ic_chongyang", R.drawable.ic_chongyang);fms.put("ic_lidong", R.drawable.ic_lidong);
		fms.put("ic_singles", R.drawable.ic_singles);fms.put("ic_thanksgiving_day", R.drawable.ic_thanksgiving_day);
		fms.put("ic_dongzhi", R.drawable.ic_dongzhi);fms.put("ic_pinganye", R.drawable.ic_pinganye);
		fms.put("ic_shengdan", R.drawable.ic_shengdan);fms.put("ic_qingnianjie", R.drawable.ic_qingnianjie);
		fms.put("ic_muqingjie", R.drawable.ic_muqingjie);
		
		//设置祝福
		fms.put("ic_everyday", R.drawable.ic_everyday);fms.put("ic_weekday", R.drawable.ic_weekday);
		fms.put("ic_birthday", R.drawable.ic_birthday);fms.put("ic_morning", R.drawable.ic_muqingjie);
		fms.put("ic_night", R.drawable.ic_night);fms.put("ic_health", R.drawable.ic_health);
		fms.put("ic_farewell", R.drawable.ic_farewell);fms.put("ic_thanks", R.drawable.ic_thanks);
		fms.put("ic_love", R.drawable.ic_love);fms.put("ic_apologize", R.drawable.ic_apologize);
		fms.put("ic_marry", R.drawable.ic_marry);fms.put("ic_born", R.drawable.ic_born);
		fms.put("ic_school", R.drawable.ic_school);fms.put("ic_graduate", R.drawable.ic_graduate);
		fms.put("ic_gaokao", R.drawable.ic_gaokao);fms.put("ic_opening", R.drawable.ic_opening);
		fms.put("ic_move", R.drawable.ic_move);fms.put("ic_promotion", R.drawable.ic_promotion);
		
		//设置其他
		fms.put("ic_express_love", R.drawable.ic_express_love);fms.put("ic_chicken_soup", R.drawable.ic_chicken_soup);
		fms.put("ic_classics_lines", R.drawable.ic_classics_lines);fms.put("ic_classics_lyric", R.drawable.ic_classics_lyric);
		fms.put("ic_famous_quotes", R.drawable.ic_famous_quotes);fms.put("ic_interest", R.drawable.ic_interest);
		fms.put("ic_embarrassment", R.drawable.ic_embarrassment);fms.put("ic_joke", R.drawable.ic_joke);
		fms.put("ic_humor", R.drawable.ic_humor);fms.put("ic_allegorical_saying", R.drawable.ic_allegorical_saying);
		fms.put("ic_parody_words", R.drawable.ic_parody_words);fms.put("ic_brilliant_reply", R.drawable.ic_brilliant_reply);
		fms.put("ic_explode", R.drawable.ic_explode);fms.put("ic_star", R.drawable.ic_star);
		fms.put("ic_english", R.drawable.ic_english);
	}
	
	public static int getLocalResourceImgId(String id){
		
		return fms.get(id);
	}
	
	//返回图片的名字 
	///upload/img/ic_thanksgiving_day.png
	public static String getImgName(String imgUrl){
		String str = imgUrl;
		//切割为：ic_everyday
		int startIndex = str.indexOf("ic_");
		int endIndex = str.indexOf(".png");
		str = str.substring(startIndex, endIndex);
		return str;
	}

}
